import service from './interceptor-02';

const request = (option: any) => {
  const { url, method, params, data, headersType, responseType } = option;
  return service.request({
    url,
    method,
    params,
    data,
    responseType,
    headers: {
      'Content-Type': headersType || 'application/json',
    },
  });
};

// export default {
//   get: <T = any>(option: any) => {
//     return request({ method: 'get', ...option });
//   },
//   post: <T = any>(option: any) => {
//     return request({ method: 'post', ...option });
//   },
//   delete: <T = any>(option: any) => {
//     return request({ method: 'delete', ...option });
//   },
//   put: <T = any>(option: any) => {
//     return request({ method: 'put', ...option });
//   },
// }
export default request;